module.exports = {
  root: true,
  env: {
    node: true,
    browser: true,
    'vue/setup-compiler-macros': true
  },
  extends: [
    'eslint:recommended',
    'plugin:vue/vue3-recommended',
    '@vue/eslint-config-typescript/recommended',
    'plugin:prettier/recommended',
    '@vue/eslint-config-prettier',
    '@element-plus/eslint-config',
    'plugin:unicorn/recommended'
  ],
  globals: {
    defineOptions: 'writable'
  },
  parser: 'vue-eslint-parser',
  parserOptions: {
    parser: '@typescript-eslint/parser',
    sourceType: 'module',
    ecmaVersion: 2020
  },
  ignores: ['node_modules', 'dist', 'public', 'src/assets', 'src/icons'],
  rules: {
    '@typescript-eslint/ban-ts-comment': 'off',
    '@typescript-eslint/no-empty-function': 'off',
    '@typescript-eslint/no-explicit-any': 'off',
    '@typescript-eslint/no-non-null-assertion': 'off',
    '@typescript-eslint/no-this-alias': 'off',
    'array-callback-return': 'off',
    'escape-case': 'off',
    'eslint-comments/no-unlimited-disable': 'off',
    'import/order': 'off',
    'lines-between-class-members': ['error', 'always'],
    'no-alert': 'off',
    'no-console': 'off',
    'no-debugger': 'off',
    'no-restricted-imports': 'off',
    'no-return-await': 'off',
    'padding-line-between-statements': [
      'error',
      { blankLine: 'always', prev: 'function', next: 'function' },
      { blankLine: 'always', prev: 'export', next: 'export' }
    ],
    'prefer-const': 'off',
    'prefer-template': 'error',
    'prettier/prettier': 'error',
    'vue/multi-word-component-names': 'off',
    'vue/no-reserved-component-names': 'off',
    'vue/no-setup-props-destructure': 'off',
    'vue/no-v-html': 'off',
    'vue/require-default-prop': 'off',
    camelcase: 'off',
    'vue/attributes-order': [
      'warn',
      {
        alphabetical: true
      }
    ],
    'vue/component-name-in-template-casing': [
      'error',
      'kebab-case',
      {
        registeredComponentsOnly: false,
        ignores: []
      }
    ],
    'vue/html-self-closing': [
      'error',
      {
        html: {
          void: 'any',
          normal: 'any',
          component: 'always'
        },
        svg: 'always',
        math: 'always'
      }
    ],
    'vue/v-on-event-hyphenation': [
      'error',
      'always',
      {
        autofix: true
      }
    ]
  }
}
